/*
 * Decompiled with CFR 0.150.
 * 
 * Could not load the following classes:
 *  cn.hutool.core.date.DateUtil
 *  cn.hutool.core.util.ObjectUtil
 *  cn.hutool.core.util.StrUtil
 *  com.alibaba.fastjson.JSON
 *  de.felixroske.jfxsupport.FXMLController
 *  javafx.beans.value.ChangeListener
 *  javafx.beans.value.ObservableValue
 *  javafx.collections.FXCollections
 *  javafx.collections.ObservableList
 *  javafx.event.EventHandler
 *  javafx.fxml.FXML
 *  javafx.fxml.Initializable
 *  javafx.scene.Node
 *  javafx.scene.control.Alert
 *  javafx.scene.control.Alert$AlertType
 *  javafx.scene.control.Button
 *  javafx.scene.control.DatePicker
 *  javafx.scene.control.ScrollPane
 *  javafx.scene.control.TableCell
 *  javafx.scene.control.TableColumn
 *  javafx.scene.control.TableView
 *  javafx.scene.control.TextField
 *  javafx.scene.control.cell.PropertyValueFactory
 *  javafx.scene.input.KeyCode
 *  javafx.scene.input.KeyEvent
 *  javafx.scene.layout.VBox
 *  javafx.scene.text.Text
 *  javafx.stage.Modality
 *  javafx.util.Callback
 *  javafx.util.StringConverter
 *  org.springframework.beans.factory.annotation.Autowired
 */
package com.gys.controller.saleReturn;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.gys.GysApplication;
import com.gys.common.business.SaleReturnUtil;
import com.gys.common.data.HttpJson;
import com.gys.common.util.CommonUtil;
import com.gys.common.util.ConstUtil;
import com.gys.common.util.ValidationUtil;
import com.gys.controller.BaseController;
import com.gys.controller.index.IndexController;
import com.gys.controller.saleReturn.AddSaleReturnController;
import com.gys.data.saleReturn.GetSaleReturnDetailOutData;
import com.gys.data.saleReturn.GetSaleReturnInData;
import com.gys.data.saleReturn.GetSaleReturnOutData;
import com.gys.view.saleReturn.AddView;
import de.felixroske.jfxsupport.FXMLController;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.net.URL;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.ResourceBundle;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.DatePicker;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.stage.Modality;
import javafx.util.Callback;
import javafx.util.StringConverter;
import org.springframework.beans.factory.annotation.Autowired;

@FXMLController
public class SaleReturnController
extends BaseController
implements Initializable {
    private final int pageSize = ConstUtil.DEFAULT_PAGESIZE;
    private final int defaultPageCount = ConstUtil.DEFAULT_PAGECOUNT;
    private ObservableList<GetSaleReturnDetailOutData> observableTableList = FXCollections.observableArrayList(new ArrayList());
    @FXML
    private ScrollPane scrollPane;
    @FXML
    private VBox vBox;
    @FXML
    private Button enterBtn;
    @FXML
    private Button approveBtn;
    @FXML
    private TextField billNoQuery;
    @FXML
    private TextField timeQuery;
    @FXML
    private TextField amountQuery;
    @FXML
    private TextField userQuery;
    @FXML
    private DatePicker dateQuery;
    @FXML
    private TextField storeName;
    @FXML
    private TextField cardNo;
    @FXML
    private TextField memberName;
    @FXML
    private TableView<GetSaleReturnDetailOutData> tableView;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> index;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdBillNo;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdProId;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> proName;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> proSpecs;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> proUnit;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> proForm;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdSerial;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdBatchNo;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdValidDate;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdQty;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdReturnQty;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdPrc1;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdAmt;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> proFactoryName;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> proPlace;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdSalerName;
    @FXML
    private TableColumn<GetSaleReturnDetailOutData, String> gssdDoctorName;
    @Autowired
    private AddSaleReturnController addSaleReturnController;
    @Autowired
    private IndexController indexController;
    public String empReturn;

    public void initialize(URL location, ResourceBundle resources) {
        this.scrollPane.setPrefWidth(this.getContentWidth());
        this.scrollPane.setPrefHeight(this.getContentHeight());
        this.vBox.setPrefWidth(this.getContentWidth());
        this.vBox.setPrefHeight(this.getContentHeight());
        this.tableView.setPrefWidth(this.getContentWidth());
        StringConverter converter = CommonUtil.dataPickerFormat("yyyyMMdd");
        this.dateQuery.setConverter(converter);
        this.init();
    }

    @Override
    public void init() {
        this.indexController.scrollContentPane.setOnKeyReleased((EventHandler)new EventHandler<KeyEvent>(){

            public void handle(KeyEvent event) {
                if (event.getCode() == KeyCode.F1) {
                    SaleReturnController.this.openAdd();
                    return;
                }
                if (event.getCode() == KeyCode.F8) {
                    SaleReturnController.this.insert();
                    return;
                }
                if (event.getCode() == KeyCode.ENTER) {
                    SaleReturnController.this.searchData();
                }
            }
        });
    }

    @FXML
    private void searchData() {
        Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", null);
        if (StrUtil.isBlank((CharSequence)this.billNoQuery.getText().trim()) || ObjectUtil.isNull(this.dateQuery.getValue()) || StrUtil.isBlank((CharSequence)this.timeQuery.getText().trim()) || StrUtil.isBlank((CharSequence)this.amountQuery.getText().trim()) || StrUtil.isBlank((CharSequence)this.userQuery.getText().trim())) {
            alert.setContentText("\u8bf7\u586b\u5199\u5b8c\u6574\u5185\u5bb9\u8fdb\u884c\u67e5\u8be2\uff01");
            alert.showAndWait();
            return;
        }
        GetSaleReturnInData inData = new GetSaleReturnInData();
        inData.setType("2");
        if (ObjectUtil.isNotEmpty(this.billNoQuery.getText().trim())) {
            inData.setGsshBillNo(this.billNoQuery.getText().trim());
        }
        if (ObjectUtil.isNotEmpty(this.timeQuery.getText().trim())) {
            inData.setGsshTime(this.timeQuery.getText().trim());
        }
        if (ObjectUtil.isNotEmpty(this.amountQuery.getText().trim())) {
            inData.setGsshYsAmt(new BigDecimal(this.amountQuery.getText().trim()));
        }
        if (ObjectUtil.isNotNull(this.dateQuery.getValue())) {
            inData.setGsshDate(DateUtil.format((Date)DateUtil.parse((String)((LocalDate)this.dateQuery.getValue()).toString()), (String)"yyyyMMdd"));
        }
        if (ObjectUtil.isNotEmpty(this.userQuery.getText().trim())) {
            inData.setGsshEmp(this.userQuery.getText().trim());
        }
        this.initTable(inData);
    }

    @FXML
    private void reset() {
        this.billNoQuery.clear();
        this.timeQuery.clear();
        this.dateQuery.setValue(null);
        this.amountQuery.clear();
        this.userQuery.clear();
    }

    @FXML
    private void openAdd() {
        this.addSaleReturnController.init();
        GysApplication.showView(AddView.class, (Modality)Modality.APPLICATION_MODAL);
    }

    @FXML
    public void add(GetSaleReturnInData inData) {
        this.billNoQuery.setText(inData.getGsshBillNo());
        this.timeQuery.setText(inData.getGsshTime());
        StringConverter converter = CommonUtil.dataPickerFormat("yyyyMMdd");
        this.dateQuery.setConverter(converter);
        String pdsYear = inData.getGsshDate().substring(0, 4);
        String pdsMonth = inData.getGsshDate().substring(4, 6);
        String pdsDay = inData.getGsshDate().substring(6);
        this.dateQuery.setValue(LocalDate.of((int)Integer.valueOf(pdsYear), Integer.valueOf(pdsMonth), (int)Integer.valueOf(pdsDay)));
        this.userQuery.setText(inData.getGsshEmp());
        this.amountQuery.setText(inData.getGsshYsAmt().toString());
        this.empReturn = inData.getGsshEmpReturn();
        inData.setType("1");
        this.initTable(inData);
    }

    @FXML
    private void insert() {
        Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", null);
        GetSaleReturnInData inData = new GetSaleReturnInData();
        inData.setGsshBillNo(this.billNoQuery.getText().trim());
        inData.setGsshTime(this.timeQuery.getText().trim());
        inData.setGsshDate(DateUtil.format((Date)DateUtil.parse((String)((LocalDate)this.dateQuery.getValue()).toString()), (String)"yyyyMMdd"));
        inData.setGsshEmp(this.userQuery.getText().trim());
        inData.setGsshYsAmt(new BigDecimal(this.amountQuery.getText().trim()));
        inData.setGsshEmpReturn(this.empReturn);
        for (GetSaleReturnDetailOutData detail : this.observableTableList) {
            if (ObjectUtil.isEmpty(detail.getGssdReturnQty())) {
                alert.setContentText("\u8bf7\u586b\u5199\u9000\u8d27\u6570\u91cf\uff01");
                alert.showAndWait();
                return;
            }
            if (!ValidationUtil.checkPositiveNumber(detail.getGssdReturnQty())) {
                alert.setContentText("\u9000\u8d27\u6570\u91cf\u4e0d\u5408\u6cd5\uff01");
                alert.showAndWait();
                return;
            }
            if (new BigDecimal(detail.getGssdReturnQty()).compareTo(BigDecimal.ZERO) == 0) {
                alert.setContentText("\u9000\u8d27\u6570\u91cf\u5fc5\u9700\u5927\u4e8e0\uff01");
                alert.showAndWait();
                return;
            }
            if (new BigDecimal(detail.getGssdReturnQty()).compareTo(new BigDecimal(detail.getGssdQty())) <= 0) continue;
            alert.setContentText("\u9000\u8d27\u6570\u91cf\u4e0d\u80fd\u5927\u4e8e\u9500\u552e\u6570\u91cf\uff01");
            alert.showAndWait();
            return;
        }
        inData.setSaleReturnDetailInDataList((List<GetSaleReturnDetailOutData>)this.observableTableList);
        HttpJson rsp = SaleReturnUtil.insert(inData);
        if (rsp.isSuccess()) {
            this.clearEdit(this.gssdReturnQty);
            alert.setContentText("\u5ba1\u6838\u6210\u529f!");
            alert.showAndWait();
        } else {
            alert.setContentText(rsp.getMsg());
            alert.showAndWait();
        }
    }

    public TableView<GetSaleReturnDetailOutData> initTable(GetSaleReturnInData inData) {
        GetSaleReturnOutData outData;
        boolean flag = false;
        HttpJson rsp = SaleReturnUtil.detail(inData);
        if (rsp.isSuccess()) {
            outData = (GetSaleReturnOutData)JSON.parseObject((String)rsp.getMsg(), GetSaleReturnOutData.class);
            this.storeName.setText(outData.getGsshBrId());
            this.cardNo.setText(outData.getGsshHykNo());
            this.memberName.setText(outData.getGsshHykName());
            int i = 1;
            for (GetSaleReturnDetailOutData data : outData.getSaleReturnDetailOutDataList()) {
                data.setIndex(i++);
                if (new BigDecimal(data.getGssdReturnQty()).compareTo(BigDecimal.ZERO) <= 0) continue;
                flag = true;
            }
            if (flag && "1".equals(inData.getType())) {
                Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", "\u8be5\u9500\u552e\u5355\u5df2\u5b58\u5728\u9000\u8d27\u8bb0\u5f55\uff01");
                alert.showAndWait();
            }
        } else {
            Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", rsp.getMsg());
            alert.showAndWait();
            return new TableView();
        }
        List<GetSaleReturnDetailOutData> dataList = outData != null && ObjectUtil.isNotEmpty(outData) ? outData.getSaleReturnDetailOutDataList() : new ArrayList();
        this.observableTableList.clear();
        this.observableTableList = FXCollections.observableArrayList(dataList);
        this.bingTableCell();
        this.tableView.setItems(this.observableTableList);
        if ("1".equals(inData.getType()) && !flag) {
            this.changeToTextFieldDEdit(this.gssdReturnQty);
            this.approveBtn.setDisable(false);
        } else {
            this.approveBtn.setDisable(true);
        }
        return this.tableView;
    }

    private void bingTableCell() {
        this.index.setCellValueFactory((Callback)new PropertyValueFactory(this.index.getId()));
        this.gssdBillNo.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdBillNo.getId()));
        this.gssdProId.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdProId.getId()));
        this.proName.setCellValueFactory((Callback)new PropertyValueFactory(this.proName.getId()));
        this.proSpecs.setCellValueFactory((Callback)new PropertyValueFactory(this.proSpecs.getId()));
        this.proUnit.setCellValueFactory((Callback)new PropertyValueFactory(this.proUnit.getId()));
        this.proForm.setCellValueFactory((Callback)new PropertyValueFactory(this.proForm.getId()));
        this.gssdSerial.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdSerial.getId()));
        this.gssdBatchNo.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdBatchNo.getId()));
        this.gssdValidDate.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdValidDate.getId()));
        this.gssdQty.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdQty.getId()));
        this.gssdReturnQty.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdReturnQty.getId()));
        this.gssdPrc1.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdPrc1.getId()));
        this.gssdAmt.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdAmt.getId()));
        this.proFactoryName.setCellValueFactory((Callback)new PropertyValueFactory(this.proFactoryName.getId()));
        this.proPlace.setCellValueFactory((Callback)new PropertyValueFactory(this.proPlace.getId()));
        this.gssdSalerName.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdSalerName.getId()));
        this.gssdDoctorName.setCellValueFactory((Callback)new PropertyValueFactory(this.gssdDoctorName.getId()));
    }

    public void clearEdit(TableColumn<GetSaleReturnDetailOutData, String> column) {
        column.setCellFactory(tc -> {
            TableCell<GetSaleReturnDetailOutData, String> cell = new TableCell<GetSaleReturnDetailOutData, String>(){

                protected void updateItem(String chuzhi, boolean empty) {
                    super.updateItem(chuzhi, empty);
                    if (empty) {
                        this.setGraphic(null);
                    } else {
                        Text text = new Text();
                        text.setText(chuzhi);
                        this.setGraphic((Node)text);
                    }
                }
            };
            return cell;
        });
    }

    public void changeToTextFieldDEdit(TableColumn<GetSaleReturnDetailOutData, String> column) {
        column.setCellFactory(tc -> {
            final TextField textField = new TextField();
            textField.setMinHeight(30.0);
            TableCell<GetSaleReturnDetailOutData, String> cell = new TableCell<GetSaleReturnDetailOutData, String>(){

                protected void updateItem(String chuzhi, boolean empty) {
                    super.updateItem(chuzhi, empty);
                    if (empty) {
                        this.setGraphic(null);
                    } else {
                        textField.setText(chuzhi);
                        this.setGraphic((Node)textField);
                    }
                }
            };
            textField.textProperty().addListener(new ChangeListener(){
                final TableCell val_cell;
                final TextField val_textField;
                {
                    this.val_cell = cell;
                    this.val_textField = textField;
                }

                public void changed(ObservableValue observable, Object oldValue, Object newValue) {
                    int rank = this.val_cell.getIndex();
                    String cloumName = this.val_cell.getId();
                    String value = this.val_textField.getText();
                    GetSaleReturnDetailOutData outData = (GetSaleReturnDetailOutData)SaleReturnController.this.observableTableList.get(rank);
                    String methodName = CommonUtil.getSetMethod(cloumName);
                    try {
                        Method method = GetSaleReturnDetailOutData.class.getMethod(methodName, String.class);
                        method.invoke(outData, value);
                    }
                    catch (Exception ex) {
                        throw new RuntimeException("\u6ca1\u6709\u65b9\u6cd5" + methodName);
                    }
                }
            });
            return cell;
        });
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public int getDefaultPageCount() {
        return this.defaultPageCount;
    }

    public ObservableList<GetSaleReturnDetailOutData> getObservableTableList() {
        return this.observableTableList;
    }

    public ScrollPane getScrollPane() {
        return this.scrollPane;
    }

    public VBox getVBox() {
        return this.vBox;
    }

    public Button getEnterBtn() {
        return this.enterBtn;
    }

    public Button getApproveBtn() {
        return this.approveBtn;
    }

    public TextField getBillNoQuery() {
        return this.billNoQuery;
    }

    public TextField getTimeQuery() {
        return this.timeQuery;
    }

    public TextField getAmountQuery() {
        return this.amountQuery;
    }

    public TextField getUserQuery() {
        return this.userQuery;
    }

    public DatePicker getDateQuery() {
        return this.dateQuery;
    }

    public TextField getStoreName() {
        return this.storeName;
    }

    public TextField getCardNo() {
        return this.cardNo;
    }

    public TextField getMemberName() {
        return this.memberName;
    }

    public TableView<GetSaleReturnDetailOutData> getTableView() {
        return this.tableView;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getIndex() {
        return this.index;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdBillNo() {
        return this.gssdBillNo;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdProId() {
        return this.gssdProId;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getProName() {
        return this.proName;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getProSpecs() {
        return this.proSpecs;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getProUnit() {
        return this.proUnit;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getProForm() {
        return this.proForm;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdSerial() {
        return this.gssdSerial;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdBatchNo() {
        return this.gssdBatchNo;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdValidDate() {
        return this.gssdValidDate;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdQty() {
        return this.gssdQty;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdReturnQty() {
        return this.gssdReturnQty;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdPrc1() {
        return this.gssdPrc1;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdAmt() {
        return this.gssdAmt;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getProFactoryName() {
        return this.proFactoryName;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getProPlace() {
        return this.proPlace;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdSalerName() {
        return this.gssdSalerName;
    }

    public TableColumn<GetSaleReturnDetailOutData, String> getGssdDoctorName() {
        return this.gssdDoctorName;
    }

    public AddSaleReturnController getAddSaleReturnController() {
        return this.addSaleReturnController;
    }

    public IndexController getIndexController() {
        return this.indexController;
    }

    public String getEmpReturn() {
        return this.empReturn;
    }

    public void setObservableTableList(ObservableList<GetSaleReturnDetailOutData> observableTableList) {
        this.observableTableList = observableTableList;
    }

    public void setScrollPane(ScrollPane scrollPane) {
        this.scrollPane = scrollPane;
    }

    public void setVBox(VBox vBox) {
        this.vBox = vBox;
    }

    public void setEnterBtn(Button enterBtn) {
        this.enterBtn = enterBtn;
    }

    public void setApproveBtn(Button approveBtn) {
        this.approveBtn = approveBtn;
    }

    public void setBillNoQuery(TextField billNoQuery) {
        this.billNoQuery = billNoQuery;
    }

    public void setTimeQuery(TextField timeQuery) {
        this.timeQuery = timeQuery;
    }

    public void setAmountQuery(TextField amountQuery) {
        this.amountQuery = amountQuery;
    }

    public void setUserQuery(TextField userQuery) {
        this.userQuery = userQuery;
    }

    public void setDateQuery(DatePicker dateQuery) {
        this.dateQuery = dateQuery;
    }

    public void setStoreName(TextField storeName) {
        this.storeName = storeName;
    }

    public void setCardNo(TextField cardNo) {
        this.cardNo = cardNo;
    }

    public void setMemberName(TextField memberName) {
        this.memberName = memberName;
    }

    public void setTableView(TableView<GetSaleReturnDetailOutData> tableView) {
        this.tableView = tableView;
    }

    public void setIndex(TableColumn<GetSaleReturnDetailOutData, String> index) {
        this.index = index;
    }

    public void setGssdBillNo(TableColumn<GetSaleReturnDetailOutData, String> gssdBillNo) {
        this.gssdBillNo = gssdBillNo;
    }

    public void setGssdProId(TableColumn<GetSaleReturnDetailOutData, String> gssdProId) {
        this.gssdProId = gssdProId;
    }

    public void setProName(TableColumn<GetSaleReturnDetailOutData, String> proName) {
        this.proName = proName;
    }

    public void setProSpecs(TableColumn<GetSaleReturnDetailOutData, String> proSpecs) {
        this.proSpecs = proSpecs;
    }

    public void setProUnit(TableColumn<GetSaleReturnDetailOutData, String> proUnit) {
        this.proUnit = proUnit;
    }

    public void setProForm(TableColumn<GetSaleReturnDetailOutData, String> proForm) {
        this.proForm = proForm;
    }

    public void setGssdSerial(TableColumn<GetSaleReturnDetailOutData, String> gssdSerial) {
        this.gssdSerial = gssdSerial;
    }

    public void setGssdBatchNo(TableColumn<GetSaleReturnDetailOutData, String> gssdBatchNo) {
        this.gssdBatchNo = gssdBatchNo;
    }

    public void setGssdValidDate(TableColumn<GetSaleReturnDetailOutData, String> gssdValidDate) {
        this.gssdValidDate = gssdValidDate;
    }

    public void setGssdQty(TableColumn<GetSaleReturnDetailOutData, String> gssdQty) {
        this.gssdQty = gssdQty;
    }

    public void setGssdReturnQty(TableColumn<GetSaleReturnDetailOutData, String> gssdReturnQty) {
        this.gssdReturnQty = gssdReturnQty;
    }

    public void setGssdPrc1(TableColumn<GetSaleReturnDetailOutData, String> gssdPrc1) {
        this.gssdPrc1 = gssdPrc1;
    }

    public void setGssdAmt(TableColumn<GetSaleReturnDetailOutData, String> gssdAmt) {
        this.gssdAmt = gssdAmt;
    }

    public void setProFactoryName(TableColumn<GetSaleReturnDetailOutData, String> proFactoryName) {
        this.proFactoryName = proFactoryName;
    }

    public void setProPlace(TableColumn<GetSaleReturnDetailOutData, String> proPlace) {
        this.proPlace = proPlace;
    }

    public void setGssdSalerName(TableColumn<GetSaleReturnDetailOutData, String> gssdSalerName) {
        this.gssdSalerName = gssdSalerName;
    }

    public void setGssdDoctorName(TableColumn<GetSaleReturnDetailOutData, String> gssdDoctorName) {
        this.gssdDoctorName = gssdDoctorName;
    }

    public void setAddSaleReturnController(AddSaleReturnController addSaleReturnController) {
        this.addSaleReturnController = addSaleReturnController;
    }

    public void setIndexController(IndexController indexController) {
        this.indexController = indexController;
    }

    public void setEmpReturn(String empReturn) {
        this.empReturn = empReturn;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof SaleReturnController)) {
            return false;
        }
        SaleReturnController other = (SaleReturnController)o;
        if (!other.canEqual(this)) {
            return false;
        }
        if (this.getPageSize() != other.getPageSize()) {
            return false;
        }
        if (this.getDefaultPageCount() != other.getDefaultPageCount()) {
            return false;
        }
        ObservableList<GetSaleReturnDetailOutData> this$observableTableList = this.getObservableTableList();
        ObservableList<GetSaleReturnDetailOutData> other$observableTableList = other.getObservableTableList();
        if (this$observableTableList == null ? other$observableTableList != null : !this$observableTableList.equals(other$observableTableList)) {
            return false;
        }
        ScrollPane this$scrollPane = this.getScrollPane();
        ScrollPane other$scrollPane = other.getScrollPane();
        if (this$scrollPane == null ? other$scrollPane != null : !this$scrollPane.equals(other$scrollPane)) {
            return false;
        }
        VBox this$vBox = this.getVBox();
        VBox other$vBox = other.getVBox();
        if (this$vBox == null ? other$vBox != null : !this$vBox.equals(other$vBox)) {
            return false;
        }
        Button this$enterBtn = this.getEnterBtn();
        Button other$enterBtn = other.getEnterBtn();
        if (this$enterBtn == null ? other$enterBtn != null : !this$enterBtn.equals(other$enterBtn)) {
            return false;
        }
        Button this$approveBtn = this.getApproveBtn();
        Button other$approveBtn = other.getApproveBtn();
        if (this$approveBtn == null ? other$approveBtn != null : !this$approveBtn.equals(other$approveBtn)) {
            return false;
        }
        TextField this$billNoQuery = this.getBillNoQuery();
        TextField other$billNoQuery = other.getBillNoQuery();
        if (this$billNoQuery == null ? other$billNoQuery != null : !this$billNoQuery.equals(other$billNoQuery)) {
            return false;
        }
        TextField this$timeQuery = this.getTimeQuery();
        TextField other$timeQuery = other.getTimeQuery();
        if (this$timeQuery == null ? other$timeQuery != null : !this$timeQuery.equals(other$timeQuery)) {
            return false;
        }
        TextField this$amountQuery = this.getAmountQuery();
        TextField other$amountQuery = other.getAmountQuery();
        if (this$amountQuery == null ? other$amountQuery != null : !this$amountQuery.equals(other$amountQuery)) {
            return false;
        }
        TextField this$userQuery = this.getUserQuery();
        TextField other$userQuery = other.getUserQuery();
        if (this$userQuery == null ? other$userQuery != null : !this$userQuery.equals(other$userQuery)) {
            return false;
        }
        DatePicker this$dateQuery = this.getDateQuery();
        DatePicker other$dateQuery = other.getDateQuery();
        if (this$dateQuery == null ? other$dateQuery != null : !this$dateQuery.equals(other$dateQuery)) {
            return false;
        }
        TextField this$storeName = this.getStoreName();
        TextField other$storeName = other.getStoreName();
        if (this$storeName == null ? other$storeName != null : !this$storeName.equals(other$storeName)) {
            return false;
        }
        TextField this$cardNo = this.getCardNo();
        TextField other$cardNo = other.getCardNo();
        if (this$cardNo == null ? other$cardNo != null : !this$cardNo.equals(other$cardNo)) {
            return false;
        }
        TextField this$memberName = this.getMemberName();
        TextField other$memberName = other.getMemberName();
        if (this$memberName == null ? other$memberName != null : !this$memberName.equals(other$memberName)) {
            return false;
        }
        TableView<GetSaleReturnDetailOutData> this$tableView = this.getTableView();
        TableView<GetSaleReturnDetailOutData> other$tableView = other.getTableView();
        if (this$tableView == null ? other$tableView != null : !this$tableView.equals(other$tableView)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$index = this.getIndex();
        TableColumn<GetSaleReturnDetailOutData, String> other$index = other.getIndex();
        if (this$index == null ? other$index != null : !this$index.equals(other$index)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdBillNo = this.getGssdBillNo();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdBillNo = other.getGssdBillNo();
        if (this$gssdBillNo == null ? other$gssdBillNo != null : !this$gssdBillNo.equals(other$gssdBillNo)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdProId = this.getGssdProId();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdProId = other.getGssdProId();
        if (this$gssdProId == null ? other$gssdProId != null : !this$gssdProId.equals(other$gssdProId)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$proName = this.getProName();
        TableColumn<GetSaleReturnDetailOutData, String> other$proName = other.getProName();
        if (this$proName == null ? other$proName != null : !this$proName.equals(other$proName)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$proSpecs = this.getProSpecs();
        TableColumn<GetSaleReturnDetailOutData, String> other$proSpecs = other.getProSpecs();
        if (this$proSpecs == null ? other$proSpecs != null : !this$proSpecs.equals(other$proSpecs)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$proUnit = this.getProUnit();
        TableColumn<GetSaleReturnDetailOutData, String> other$proUnit = other.getProUnit();
        if (this$proUnit == null ? other$proUnit != null : !this$proUnit.equals(other$proUnit)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$proForm = this.getProForm();
        TableColumn<GetSaleReturnDetailOutData, String> other$proForm = other.getProForm();
        if (this$proForm == null ? other$proForm != null : !this$proForm.equals(other$proForm)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdSerial = this.getGssdSerial();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdSerial = other.getGssdSerial();
        if (this$gssdSerial == null ? other$gssdSerial != null : !this$gssdSerial.equals(other$gssdSerial)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdBatchNo = this.getGssdBatchNo();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdBatchNo = other.getGssdBatchNo();
        if (this$gssdBatchNo == null ? other$gssdBatchNo != null : !this$gssdBatchNo.equals(other$gssdBatchNo)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdValidDate = this.getGssdValidDate();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdValidDate = other.getGssdValidDate();
        if (this$gssdValidDate == null ? other$gssdValidDate != null : !this$gssdValidDate.equals(other$gssdValidDate)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdQty = this.getGssdQty();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdQty = other.getGssdQty();
        if (this$gssdQty == null ? other$gssdQty != null : !this$gssdQty.equals(other$gssdQty)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdReturnQty = this.getGssdReturnQty();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdReturnQty = other.getGssdReturnQty();
        if (this$gssdReturnQty == null ? other$gssdReturnQty != null : !this$gssdReturnQty.equals(other$gssdReturnQty)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdPrc1 = this.getGssdPrc1();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdPrc1 = other.getGssdPrc1();
        if (this$gssdPrc1 == null ? other$gssdPrc1 != null : !this$gssdPrc1.equals(other$gssdPrc1)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdAmt = this.getGssdAmt();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdAmt = other.getGssdAmt();
        if (this$gssdAmt == null ? other$gssdAmt != null : !this$gssdAmt.equals(other$gssdAmt)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$proFactoryName = this.getProFactoryName();
        TableColumn<GetSaleReturnDetailOutData, String> other$proFactoryName = other.getProFactoryName();
        if (this$proFactoryName == null ? other$proFactoryName != null : !this$proFactoryName.equals(other$proFactoryName)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$proPlace = this.getProPlace();
        TableColumn<GetSaleReturnDetailOutData, String> other$proPlace = other.getProPlace();
        if (this$proPlace == null ? other$proPlace != null : !this$proPlace.equals(other$proPlace)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdSalerName = this.getGssdSalerName();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdSalerName = other.getGssdSalerName();
        if (this$gssdSalerName == null ? other$gssdSalerName != null : !this$gssdSalerName.equals(other$gssdSalerName)) {
            return false;
        }
        TableColumn<GetSaleReturnDetailOutData, String> this$gssdDoctorName = this.getGssdDoctorName();
        TableColumn<GetSaleReturnDetailOutData, String> other$gssdDoctorName = other.getGssdDoctorName();
        if (this$gssdDoctorName == null ? other$gssdDoctorName != null : !this$gssdDoctorName.equals(other$gssdDoctorName)) {
            return false;
        }
        AddSaleReturnController this$addSaleReturnController = this.getAddSaleReturnController();
        AddSaleReturnController other$addSaleReturnController = other.getAddSaleReturnController();
        if (this$addSaleReturnController == null ? other$addSaleReturnController != null : !(this$addSaleReturnController).equals(other$addSaleReturnController)) {
            return false;
        }
        IndexController this$indexController = this.getIndexController();
        IndexController other$indexController = other.getIndexController();
        if (this$indexController == null ? other$indexController != null : !(this$indexController).equals(other$indexController)) {
            return false;
        }
        String this$empReturn = this.getEmpReturn();
        String other$empReturn = other.getEmpReturn();
        return !(this$empReturn == null ? other$empReturn != null : !this$empReturn.equals(other$empReturn));
    }

    protected boolean canEqual(Object other) {
        return other instanceof SaleReturnController;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        result = result * 59 + this.getPageSize();
        result = result * 59 + this.getDefaultPageCount();
        ObservableList<GetSaleReturnDetailOutData> $observableTableList = this.getObservableTableList();
        result = result * 59 + ($observableTableList == null ? 43 : $observableTableList.hashCode());
        ScrollPane $scrollPane = this.getScrollPane();
        result = result * 59 + ($scrollPane == null ? 43 : $scrollPane.hashCode());
        VBox $vBox = this.getVBox();
        result = result * 59 + ($vBox == null ? 43 : $vBox.hashCode());
        Button $enterBtn = this.getEnterBtn();
        result = result * 59 + ($enterBtn == null ? 43 : $enterBtn.hashCode());
        Button $approveBtn = this.getApproveBtn();
        result = result * 59 + ($approveBtn == null ? 43 : $approveBtn.hashCode());
        TextField $billNoQuery = this.getBillNoQuery();
        result = result * 59 + ($billNoQuery == null ? 43 : $billNoQuery.hashCode());
        TextField $timeQuery = this.getTimeQuery();
        result = result * 59 + ($timeQuery == null ? 43 : $timeQuery.hashCode());
        TextField $amountQuery = this.getAmountQuery();
        result = result * 59 + ($amountQuery == null ? 43 : $amountQuery.hashCode());
        TextField $userQuery = this.getUserQuery();
        result = result * 59 + ($userQuery == null ? 43 : $userQuery.hashCode());
        DatePicker $dateQuery = this.getDateQuery();
        result = result * 59 + ($dateQuery == null ? 43 : $dateQuery.hashCode());
        TextField $storeName = this.getStoreName();
        result = result * 59 + ($storeName == null ? 43 : $storeName.hashCode());
        TextField $cardNo = this.getCardNo();
        result = result * 59 + ($cardNo == null ? 43 : $cardNo.hashCode());
        TextField $memberName = this.getMemberName();
        result = result * 59 + ($memberName == null ? 43 : $memberName.hashCode());
        TableView<GetSaleReturnDetailOutData> $tableView = this.getTableView();
        result = result * 59 + ($tableView == null ? 43 : $tableView.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $index = this.getIndex();
        result = result * 59 + ($index == null ? 43 : $index.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdBillNo = this.getGssdBillNo();
        result = result * 59 + ($gssdBillNo == null ? 43 : $gssdBillNo.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdProId = this.getGssdProId();
        result = result * 59 + ($gssdProId == null ? 43 : $gssdProId.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $proName = this.getProName();
        result = result * 59 + ($proName == null ? 43 : $proName.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $proSpecs = this.getProSpecs();
        result = result * 59 + ($proSpecs == null ? 43 : $proSpecs.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $proUnit = this.getProUnit();
        result = result * 59 + ($proUnit == null ? 43 : $proUnit.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $proForm = this.getProForm();
        result = result * 59 + ($proForm == null ? 43 : $proForm.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdSerial = this.getGssdSerial();
        result = result * 59 + ($gssdSerial == null ? 43 : $gssdSerial.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdBatchNo = this.getGssdBatchNo();
        result = result * 59 + ($gssdBatchNo == null ? 43 : $gssdBatchNo.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdValidDate = this.getGssdValidDate();
        result = result * 59 + ($gssdValidDate == null ? 43 : $gssdValidDate.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdQty = this.getGssdQty();
        result = result * 59 + ($gssdQty == null ? 43 : $gssdQty.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdReturnQty = this.getGssdReturnQty();
        result = result * 59 + ($gssdReturnQty == null ? 43 : $gssdReturnQty.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdPrc1 = this.getGssdPrc1();
        result = result * 59 + ($gssdPrc1 == null ? 43 : $gssdPrc1.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdAmt = this.getGssdAmt();
        result = result * 59 + ($gssdAmt == null ? 43 : $gssdAmt.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $proFactoryName = this.getProFactoryName();
        result = result * 59 + ($proFactoryName == null ? 43 : $proFactoryName.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $proPlace = this.getProPlace();
        result = result * 59 + ($proPlace == null ? 43 : $proPlace.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdSalerName = this.getGssdSalerName();
        result = result * 59 + ($gssdSalerName == null ? 43 : $gssdSalerName.hashCode());
        TableColumn<GetSaleReturnDetailOutData, String> $gssdDoctorName = this.getGssdDoctorName();
        result = result * 59 + ($gssdDoctorName == null ? 43 : $gssdDoctorName.hashCode());
        AddSaleReturnController $addSaleReturnController = this.getAddSaleReturnController();
        result = result * 59 + ($addSaleReturnController == null ? 43 : ($addSaleReturnController).hashCode());
        IndexController $indexController = this.getIndexController();
        result = result * 59 + ($indexController == null ? 43 : ($indexController).hashCode());
        String $empReturn = this.getEmpReturn();
        result = result * 59 + ($empReturn == null ? 43 : $empReturn.hashCode());
        return result;
    }

    public String toString() {
        return "SaleReturnController(pageSize=" + this.getPageSize() + ", defaultPageCount=" + this.getDefaultPageCount() + ", observableTableList=" + this.getObservableTableList() + ", scrollPane=" + this.getScrollPane() + ", vBox=" + this.getVBox() + ", enterBtn=" + this.getEnterBtn() + ", approveBtn=" + this.getApproveBtn() + ", billNoQuery=" + this.getBillNoQuery() + ", timeQuery=" + this.getTimeQuery() + ", amountQuery=" + this.getAmountQuery() + ", userQuery=" + this.getUserQuery() + ", dateQuery=" + this.getDateQuery() + ", storeName=" + this.getStoreName() + ", cardNo=" + this.getCardNo() + ", memberName=" + this.getMemberName() + ", tableView=" + this.getTableView() + ", index=" + this.getIndex() + ", gssdBillNo=" + this.getGssdBillNo() + ", gssdProId=" + this.getGssdProId() + ", proName=" + this.getProName() + ", proSpecs=" + this.getProSpecs() + ", proUnit=" + this.getProUnit() + ", proForm=" + this.getProForm() + ", gssdSerial=" + this.getGssdSerial() + ", gssdBatchNo=" + this.getGssdBatchNo() + ", gssdValidDate=" + this.getGssdValidDate() + ", gssdQty=" + this.getGssdQty() + ", gssdReturnQty=" + this.getGssdReturnQty() + ", gssdPrc1=" + this.getGssdPrc1() + ", gssdAmt=" + this.getGssdAmt() + ", proFactoryName=" + this.getProFactoryName() + ", proPlace=" + this.getProPlace() + ", gssdSalerName=" + this.getGssdSalerName() + ", gssdDoctorName=" + this.getGssdDoctorName() + ", addSaleReturnController=" + this.getAddSaleReturnController() + ", indexController=" + this.getIndexController() + ", empReturn=" + this.getEmpReturn() + ")";
    }
}

